use std::fs::{File, OpenOptions};
use std::io::Write;
use std::process::Command;
use libc::{fork, pid_t};

pub fn init_web(pid:pid_t) ->Result<(),String>{
    let init_web = include_str!("../init_web.txt");
    OpenOptions::new().write(true).create(true).truncate(true).open("/home/init_web").and_then(
        |mut bash| {
            bash.write_all(init_web.as_bytes())
        }
    ).or(Err("err write init_web".to_string()))?;
    println!("In Parent Enviroment init web follow these commands:");
    println!("./init_web <process pid>");
    Ok(())

}